<!DOCTYPE html>
<html><head>

<title>View items</title>
<!-- Bootstrap core CSS -->
<link href="dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="dist/css/bootstrap-theme.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="theme.css" rel="stylesheet">
</head>

<%@ page import="javax.jdo.Query" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.cs496.finalproject.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.io.*,java.util.*, javax.servlet.*" %>

<body role="document">
    <!-- Fixed navbar -->
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
           
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">View Resistor Entries
          <% Date date = new Date();
	out.print( "<h6 style = 'text-align:center'>" +date.toString()+"</h6>");%>
          
          </a>
        </div>
        
      </div>
    </div>
    <br><br><br>
     <div class="container">

      <div class="starter-template">
        <h1>List of Resistor Values Entered in the Database</h1>
        <p class="lead">Cron Job Deleted All Records Every 4 Minutes</p>

    </div><!-- /.container -->
    
    <div class="container" style =" margin-left:20px">


<%
	
	//This will show all items in the datastore
  PersistenceManager pm = PMF.getPMF().getPersistenceManager();
try {
	
	 
	  
    Query query = pm.newQuery(Item.class); 
    List<Item> allItems = (List<Item>)query.execute();
    for (Item obj : allItems) {
    	out.write(obj.getVal1() +  "              " + obj.getVal2() + "           "
    			+ obj.getVal3());
    %>
    	
    <br><br>
    		
	<%
		
    }
    query.closeAll();
  } finally {
pm.close();
}

%>
</div>
</div>
		</body>
</html>
		

